#include <bits/stdc++.h>

#define PSI pair<string,int>
#define PII pair<int,int>
#define VVI vector<vector<int>>
#define VI vector<int>
#define VS vector<string>

#define PQLI priority_queue<int, vector<int>, less<int>>
#define PQGI priority_queue<int, vector<int>, greater<int>>
#define i64 long long

using namespace std;

const int N = 1e5 + 5;
int ans;

void solve() {
    int  H, W , Y;
    cin >> H >> W >>Y;
    vector<vector<int>> a(H,vector(W,0)),sunk(H,vector(W,0));
    for(int i = 0 ;i <H ; i ++){
        for(int j = 0; j < W; j ++){
            cin >> a[i][j];
        }
    }
    int retain  =  H * W;
    vector<int> f(Y + 5,0);
    for(int k = 1 ; k <= Y ; k ++){
        int temp = 0;
        for(int i = 0 ;i <H ; i ++){
            for(int j = 0; j < W; j ++){
                if(a[i][j] <= k){
                    temp ++;
                }
            }
        }
    }
    for(int i = 1 ;i <= Y ; i ++){
        cout << f[i] << "\n";
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
//    cin >> T;
    while (T--) solve();
//    cout << "\n"[];
    return 0;
}